package com.syauto.sm;

import com.syauto.user.OrderInfo;

import android.content.Intent;
import android.os.Bundle;
//import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.TextView;

public class PriceInfoActivity extends BaseActivity 
{

	EditText BodyPrice;
	EditText PurchaseTax;
	EditText AmountPolicy;
	TextView QualityCosts;
	EditText CommercialInsurance;
	EditText OemCosts;
	EditText TrafficInsurance;
	EditText SpeciFee;
	EditText TravelTax;
	EditText Other;
	EditText TotalOrder;
	EditText Deposit;
	
	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		this.setContentView(R.layout.order_price_info);

		BodyPrice = (EditText) this.findViewById(R.id.etBodyPrice);
		PurchaseTax = (EditText) this.findViewById(R.id.etPurchaseTax);
		AmountPolicy = (EditText) this.findViewById(R.id.etAmountPolicy);
		QualityCosts = (TextView) this.findViewById(R.id.tvQualityCosts);
		QualityCosts.setOnClickListener(new QualityCosts_Click());
		CommercialInsurance = (EditText) this.findViewById(R.id.etCommercialInsurance);
		OemCosts =(EditText) this.findViewById(R.id.etOemCosts);
		TrafficInsurance = (EditText) this.findViewById(R.id.etTrafficInsurance);
		SpeciFee = (EditText) this.findViewById(R.id.etSpeciFee);
		TravelTax = (EditText) this.findViewById(R.id.etTravelTax);
		Other = (EditText) this.findViewById(R.id.etOther);
		TotalOrder = (EditText) this.findViewById(R.id.etTotalOrder);
		Deposit = (EditText) this.findViewById(R.id.etDeposit);
		
		loadData();
	}
	
	private void loadData()
	{
		try
		{
			BodyPrice.setText(OrderInfo.orderdetail.getOrder_Cost_CarPrice() + "");
			PurchaseTax.setText(OrderInfo.orderdetail.getOrder_Cost_GouZhiShui() + "");
			AmountPolicy.setText(OrderInfo.orderdetail.getOrder_Cost_BaoXian() + "");
			QualityCosts.setText(OrderInfo.orderdetail.getOrder_Cost_CarJingPin() + "");
			CommercialInsurance.setText(OrderInfo.orderdetail.getOrder_Cost_TiePaiFei() + "");
			OemCosts.setText(OrderInfo.orderdetail.getOrder_Cost_TiePaiFei() + "");
			TrafficInsurance.setText(OrderInfo.orderdetail.getOrder_Cost_JiaoQiangXian() + "");
			SpeciFee.setText(OrderInfo.orderdetail.getOrder_Cost_TeBieGuiGeFei() + "");
			TravelTax.setText(OrderInfo.orderdetail.getOrder_Cost_CheChuangShui() + "");
			Other.setText(OrderInfo.orderdetail.getOrder_Cost_ElseValue2() + "");
			TotalOrder.setText(OrderInfo.orderdetail.getOrder_Cost_AllSum() + "");
			Deposit.setText(OrderInfo.orderdetail.getOrder_FuKuan_DingJinJinE() + "");	
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
	}

	@Override
	protected void handleTitleBarEvent(int paramInt) {
		// TODO Auto-generated method stub

	}
	
	class QualityCosts_Click implements OnClickListener {
		
		@Override
		public void onClick(View arg0) {
			
			Intent intent = new Intent();
			intent.setClass(PriceInfoActivity.this, AftermarketChoose.class);
			PriceInfoActivity.this.startActivity(intent);
			
		}

	}

}
